﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Security;
using umbraco.cms.businesslogic.member;

namespace UmbracoAndroid
{
    public class Authentication
    {
        public static bool Login(string userName, string password)
        {
            if (System.Web.Security.Membership.ValidateUser(userName, password))
            {
                FormsAuthentication.SetAuthCookie(userName, true);
                return true;
            }
            return false;
        }

        public static bool IsAuthenticated()
        {
            return Member.GetCurrentMember() != null;
        }
    }
}
